package com.bensonbasement.snorflux.memory;

import com.bensonbasement.snorflux.server.world.ILocation;

public abstract class REntity extends RWorldElement {
	
	public REntity(RWorld world) {
		super(world);
	}
	
	public abstract IRLocation getLocation();
	/**
	 * Sets the location to null.
	 */
	public abstract void leaveLocation();
	
	public RLevel getLevel() {
		return this.getSpace().getLevel();
	}
	
	public RSpace getSpace() {
		IRLocation location = this.getLocation();
		if (location == null) {
			return null;
		}
		else {
			return location.getSpace();
		}
	}
	
	@Override
	protected abstract EntityInfo getInfo();
}
